<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>教师后台-不学也通-系部添加</title>
    <link rel="shortcut icon" href="../康笑长结业课.jpg" type="image/x-icon">
    <style>
        .container {
            min-height: 100vh;
        }

        .container .nav {
            height: 100%;
            background-color: #fff;
        }

        .link-secondary{
            text-decoration: none;
        }
        .link-secondary:hover{
            color: #0d6efd !important;
        }
    </style>
</head>

<body>
    <!-- container是bootstrap的居中窄的显示方案 -->
    <div class="container bg-body">
        <div class="row">
            <div class="col-md-2 leftmenu" id="leftmenu">
                
            </div>
            <div class="col-md-9 kc ms-3">
                <div class="row mt-3 pd-3 border-bottom border-secondary">
                    <div class="col-md-2">添加系部</div>
                    <div class="col-md-1 offset-md-8">
                        <a class="nav-link link-success" href="javascript:history.go(-1)">返回</a>
                    </div>
            </div>
            <div class="row mt-3">
                <form>
                   <div class="mb-3 row">
                       <label for="department_name" class="col-sm-2 col-form-label">系部名称:</label>
                       <div class="col-sm-10">
                         <input type="text" class="form-control" id="department_name">
                       </div>
                     </div>
                     <div class="mb-3 row">
                       <label for="department_code" class="col-sm-2 col-form-label">系部编码号:</label>
                       <div class="col-sm-10">
                         <input type="text" class="form-control" id="department_code">
                       </div>
                     </div>
                     <div class="mb-3 row">
                        <label for="school_code" class="col-sm-2 col-form-label">学校编码号:</label>
                        <div class="col-sm-10">
                          <input type="text" class="form-control" id="school_code">
                        </div>
                      </div>
                     <div class="mb-3 row">
                       <div class="col-sm-12">
                           <button type="button" class="btn btn-outline-primary">提交</button>
                       </div>
                     </div>
                </form>
           </div>
       </div>
   </div>
</div>
    <script type="module" src="../js/main.js"></script>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/common.js"></script>
    <script>
        $(document).ready(function(){
            $(".btn-outline-primary").click(function(){
                let department_name = $("#department_name").val()
                let department_code = $("#department_code").val()
                let school_code = $("#school_code").val()

                $.post("http://unicloud.codecore.cn/ms/departCreate",{
                    department_name:department_name,
                    department_code:department_code,
                    school_code:school_code,
                    
                },function(params) {
                    if (params.errCode == 0) {
                        location.href = " ./depart.html"
                    }else{
                        alert("添加失败")
                    }
                })
            })
 })

    
    </script>
</body>

</html>